import request from '@/utils/request'
import { exportMethod } from '@/utils/utils'
// import * as proxy from '@/constants/proxy'

//获取详情
export function getDetail(id: any) {
  return request({
    url: '/checc-api/budget/ysgl/budgetform/list',
    method: 'post',
  })
}
// 列表数据
export function getList(params: any) {
  return request({
    url: '/checc-api/ysgl/budgetform/list',
    method: 'post',
    params,
  })
}
// 新增
export function insert(params: any) {
  return request({
    url: '/checc-api/ysgl/budgetform/insert',
    method: 'post',
    params,
  })
}
//修改
export function update(params: any) {
  return request({
    url: '/checc-api/ysgl/budgetform/update',
    method: 'post',
    params,
  })
}
// 删除
export function deleteAll(params: any) {
  return request({
    url: '/checc-api/ysgl/budgetform/delete',
    method: 'post',
    params,
  })
}
export function selectItemOpen(params: any) {
  return request({
    url: '/checc-api/ysgl/monthReport/select',
    method: 'post',
    params,
  })
}
export function monthReportUpdate(data: any) {
  return request({
    url: '/checc-api/ysgl/monthReport/update',
    method: 'post',
    data,
  })
}
export function getOrgInfo() {
  return request({
    url: '/checc-api/kjsl/common/getOrgsByLoginUser',
    method: 'get',
  })
}

// 数字化经费
export function databasedList(params) {
  return request({
    url: '/checc-api/ysgl/databasedBudgetAll/list',
    method: 'post',
    params,
  })
}
export function getTotalList(params) {
  return request({
    url: '/checc-api/ysgl/databasedBudgetAll/getTotalList',
    method: 'post',
    params,
  })
}
export function databasedinsert(data) {
  return request({
    url: '/checc-api/ysgl/databasedBudgetAll/insert',
    method: 'post',
    data,
  })
}
export function databaseddelete(data) {
  return request({
    url: '/checc-api/ysgl/databased/delete',
    method: 'post',
    data,
  })
}
export function getAccountType() {
  return request({
    url: '/checc-api/ysgl/databased/getAccountType',
    method: 'post',
  })
}
export function databasedupdate(params) {
  return request({
    url: '/checc-api/ysgl/databased/update',
    method: 'post',
    params,
  })
}

export function getExport(data: any,fileName:any){
  const params = {
    method:'post',
    url: '/checc-api/ysgl/budgetform/export',
    data:data,
    fileName:fileName
  }
  return exportMethod(params)
  
}


// 数字化

export function getDigitalExport(data: any,fileName:any){
  const params = {
    method:'post',
    url: '/checc-api/ysgl/databasedBudgetAll/export',
    data:data,
    fileName:fileName
  }
  return exportMethod(params)
}


export function  startProcess(data: any){
  return request({
    url: '/process-api/act/run/startProcess',
    method: 'post',
    data
  })
}

export function  allowProcess(data: any){
  return request({
    url: '/process-api/act/task/completeTaskByVo',
    method: 'post',
    data
  })
}


export function  refuseProcess(data: any){
  return request({
    url: '/process-api/act/task/over',
    method: 'post',
    data
  })
}






